package com.iotp.service.video;

import com.iotp.dao.video.VideoMapper;
import com.iotp.entity.video.Video;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service("videoService")
public class VideoServiceImpl implements VideoService {

    @Autowired
    private VideoMapper videoMapper;


    @Override
    public void add(Video video) {
        this.videoMapper.insert(video);
    }

    @Override
    public Video selectById(Long id) {
        return this.videoMapper.selectByPrimaryKey(id);
    }

    @Override
    public void update(Video video) {
        this.videoMapper.updateByPrimaryKeySelective(video);
    }

    @Override
    public void delete(Long id) {
        this.videoMapper.deleteByPrimaryKey(id);
    }

    @Override
    public List<Video> selectList(Video video) {
        return this.videoMapper.selectByCondition(video);
    }
}
